import React, { Component } from 'react'
import './index.scss'
export default class Checkbox extends Component {
  constructor (props) {
    super(props)
  }
  onChange () {
    this.props.onChange && this.props.onChange(!this.props.checked)
  }
  getClass () {
    return {}
  }
  render () {
    return (
      <label>
        <span
        className={ this.props.checked ? 'tbcCheckboxSpan tbcCheckboxSpanActive' : 'tbcCheckboxSpan' }>
          <span className={ this.props.isSemi ? 'tbcCheckboxInnerSemi' : 'tbcCheckboxInner' }></span>
          <input className="tbcCheckboxInput" type="Checkbox" checked={this.props.checked} onChange={this.onChange.bind(this)}></input>
        </span>
        <span>{this.props.children}</span>
      </label>
    )
  }
} 